from flask import Flask
import logging

# 设置日志级别和格式
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')

app = Flask(__name__)


@app.route('/')
def hello_world():
    logging.info('开始测试')  # 日志记录语句
    return 'Hello World!'


if __name__ == '__main__':
    app.run(host="0.0.0.0", port=5000) 
